'use strict';

const Controller = require('egg').Controller;

class Chatroom extends Controller {
  async sendMsg() {
    const { ctx, app } = this;
    const message = ctx.args[0];
    message.username = ctx.session.username;
   console.log(message);
    app.io.of('/').emit('returnMsg', message);
  }
}

module.exports = Chatroom;